#ifndef JELLY_SHARE_SRC_IO_FILE_IO_H_
#define JELLY_SHARE_SRC_IO_FILE_IO_H_

#include "src/type_define.h"

namespace jellyfish
{
	namespace io
	{
		class file_io
		{
		public:
			virtual ~file_io(){}
			virtual bool open(const char* file_path,const char* mode) = 0;
			virtual void close() = 0;
			virtual uint64 seek(int64 offset, uint32 from) = 0;
			virtual uint64 get_position() const = 0;
			virtual uint64 get_length() const = 0;
			virtual uint32 read(void* buf, uint32 count) = 0;
			virtual uint32 write(const void* buf, uint32 count) = 0;
			template<class T>
			T read_t()
			{
				T value;
				read(&value, sizeof(T));
				return value;
			}
			template<class T>
			void write_t(T value)
			{
				write(&value,sizeof(T));
			}
		};

	}
}




#endif  // JELLY_SHARE_SRC_IO_FILE_IO_H_
